// 计算薪资抽象基类
public abstrace class Salary
{
    // 基本工资
    public abstract double BasicSalary { get; }

    public Salary(double basicSalary)
    {
        this.BasicSalary = basicSalary;
    }

    // 计算薪资
    public double Calc(int dayWorks, int dayTotal, double performance, int sales)
    {
        return this.BasicSalary + Attendance(dayWorks, dayTotal) + Performance(performance) + SaleDone(sales);
    }

    // 考勤
    public abstract double Attendance(int dayWorks, int dayTotal);

    // 绩效
    public abstract double Performance(double performance);

    // 成交量
    public virtual double SaleDone(int num)
    {
        return 0;
    }
}

// 网络部薪资
public class NetDepartmentSalary: Salary
{
    public override Attendance(int dayWorks, int dayTotal)
    {
        return (this.BasicSalary / dayTotal) * dayWorks;
    }

    public override Performance(double performance)
    {
        return this.BasicSalary * performance;
    }
}

// 人力资源部薪资
public class EmployeeResourceSalary: Salary
{
    public override Attendance(int dayWorks, int dayTotal)
    {
        return (this.BasicSalary / dayTotal) * dayWorks;
    }

    public override Performance(double performance)
    {
        return this.BasicSalary * performance;
    }  
}

// 置业部 薪资
public class BusinessDeptSalary: Salary
{
    public override Attendance(int dayWorks, int dayTotal)
    {
        return (this.BasicSalary / dayTotal) * dayWorks;
    }

    public override Performance(double performance)
    {
        return this.BasicSalary * performance;
    }

    // 成交量
    public override SaleDone(int num)  
    {
        return num / 100 * 10000;
    }
}

// 本月员工工作信息
public class Employee
{
    public string Name {get;set;}
    public double BasicSalary {get; set;}

    public int Month {get;set;}
    public int DayWorks {get;set;}
    public double Performance {get;set;}
    public int SaleDone {get; set;}
}

// 消费场景
public class MainApp
{
    public static void Main()
    {
        Salary netSalary = new NetDepartmentSalary();
        var netSalaryPay = netSalary.Calc();

        Salary empResSalary = new EmployeeResourceSalary();
        var empSalaryPay = empResSalary.Calc();
    }
}